<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = ['html','css','js']
        for(var key in arr){  //key获取的是数组的下标
            console.log(arr[key])
        }
        var arr1 = [
            {name:"肯德基",price:100,distance:100,num:2},
            {name:"必胜客",price:200,distance:500,num:1},
            {name:"华莱士",price:50,distance:1000,num:5}
        ]
        for(var k in arr1){//对象的属性
            console.log(arr1[k].name)
        }
        var arr2 = [3,4,5]
        for(var value of arr2){
            console.log(value);
            console.log(arr2.indexOf(value));    
        }
        
    </script>
</body>
</html>